<template>
  <div class="wrapper">
    <div class="header-div">
      <div class="search-div">
        <input class="input-class" placeholder="请输入" type="text"/>
        <div class="search-button button-tr-br-radius"><a href="javascript:void(0)">搜索</a></div>
        <span class="event-clo">
         <a href="javascript:void(0)" v-on:click="showCont"><span>收起  &emsp; △</span></a>
        </span>
      </div>
      <div class="select-and-time" v-if="show">
        <div class="select-label">
          <label>其他选项：展示状态：</label>
        </div>
        <div class="arow1">
          <input type="text" id="select-state" v-model="selectStateValue" class="input-class" placeholder="展示中" readonly
                 @blur="ul_hide" @focus="ul_show"/>
          <ul class="showUlleft" id="listsShowUlleft" v-if="show_ul" v-on:click="selectState">
            <li><a href="javascript:void(0)">展示中</a></li>
            <li><a href="javascript:void(0)">已下架</a></li>
          </ul>
        </div>
        <div class="arow2">
          <div class="arowMain input-number">
            <div class="arow2">
              <label>发布时间：</label>
            </div>
            <div class="arow2">
              <input type="number"/>
            </div>
            <label class="arow-mini3">:</label>
            <div class="arow2">
              <input type="number"/>
            </div>
            <label class="arow-mini3">至</label>
            <div class="arow2">
              <input type="number"/>
            </div>
            <label class="arow-mini3">:</label>
            <div class="arow2">
              <input type="number"/>
            </div>
          </div>
        </div>
        <div class="search-button button-radius position-button">
          <a v-on:click="addChildrenHealth" href="javascript:void(0)">新增儿童健康</a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
    export default {
        name: "ChildrenHealthHeader",
        data() {
            return {
                name: 'Vue.js',
                show: true,
                show_ul: false,
                selectStateValue: ''
            }
        },
        methods: {
            greet: function (event) {
                alert('Hello ' + this.name + '!');
                if (event) {
                    alert(event.target.tagName)
                }
            },
            showCont: function () {
                this.show = !this.show;
            },
            ul_hide: function () {
                setTimeout(() => {
                    this.show_ul = !this.show_ul;
                }, 200);
            },
            ul_show: function () {
                this.show_ul = !this.show_ul;
            },
            selectState: function (e) {
                this.selectStateValue = e.target.text;
            },
            addChildrenHealth() {
                console.log('新增');
                /*this.$http.get('http://localhost:80/addChildrenHealth?itemCode=' + itemCode)
                    .then((res) => {
                        console.log(res.bodyText);
                    })*/
            }
        }
    }
</script>

<style scoped>

  * {
    padding: 0;
    margin: 0;
  }

  .wrapper {

  }

  .search-div {
    width: 100%;
    border-bottom: 0.6px #666666 dashed;
    margin-bottom: 15px;
    display: flex;
  }

  .search-div > input {
    float: left;
    margin-bottom: 15px;
  }

  .search-div > div {
    float: left;
    margin-bottom: 15px;
  }

  .header-div {
    width: 80%;
    margin: 0 auto;
    padding: 0 auto;
  }

  .select-label {
    text-align: left;
    height: 80px;
  }

  .input-class {
    width: 250px;
    height: 30px;
    line-height: 1.3;
    border-width: 1px;
    border-style: solid;
    background-color: #fff;
    color: rgba(0, 0, 0, .85);
    border-radius: 2px;
    border-color: #eee;
    outline: none;
    display: block;
    padding-left: 10px;

  }

  .showUlleft {
    background-color: white;
    text-indent: 15px;
    list-style: none;
    border: .3px gainsboro solid;
    width: 262px;
    position: relative;
  }

  .button-tr-br-radius {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }

  .button-radius {
    border-radius: 5px;
  }

  .position-button {
    position: absolute;
    bottom: 5px;
    left: 5px;
  }

  .search-button {
    text-align: center;
    line-height: 30px;
    background-color: #D60000;
    height: 30px;
    padding: 0 15px 0 15px;
    color: white;
  }

  .search-button > a {
    text-decoration: none;
    color: white;
    display: block;
    font-size: 10px;
  }

  .event-clo {
    flex: 1;
  }

  .event-clo > a {
    float: right;
    text-decoration: none;
    color: #D60000;
  }

  .showUlleft > li {
    display: block;
    width: 250px;
    padding-left: 10px;
  }

  .showUlleft > li > a {
    display: block;
    width: 250px;
    text-decoration: none;
    color: #333333;
    text-align: left;
  }

  .arow1 {
    flex: 1;
    text-align: left;
    /*align-items: left;*/
  }

  .arow2 {
    flex: 2;
  }

  .arow-mini3 {
    flex: 0.1;
    padding-left: 10px;
    padding-right: 5px;
    align-items: center;
    text-align: center;
  }

  .arowMain {
    display: flex;
  }

  .input-number > div > input {
    width: 100%;
    height: 25px;
    font-size: 25px;

    line-height: 1.3;
    border-width: 1px;
    border-style: solid;
    background-color: #fff;
    color: rgba(0, 0, 0, .85);
    border-radius: 2px;
    border-color: #eee;
    box-shadow: #666 0 0 4px;
    padding-left: 5px;
    outline: none;
    display: block;
  }

  .showUlleft > li:hover {
    background-color: #1E90FF;
  }

  .select-and-time {
    display: flex;
    position: relative;
  }

</style>
